package com.oreilly.ez.repo;

import com.oreilly.ez.entity.Card;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;


@RepositoryRestResource
public interface CardRepo extends JpaRepository<Card, Integer> {


    @Query(value = "select * from Card  c where c.card_num = :cardNum", nativeQuery = true)
    Card findByCardNum(@Param("cardNum") String cardNum);
}
